package com.paul.sys.service.impl;

import com.paul.sys.mapper.DigroadInfoMapper;
import com.paul.sys.service.DigroadInfoService;
import com.paul.sys.tools.CommPageBean;
import com.paul.sys.tools.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.paul.sys.model.DigroadInfo;
/**
 * Created by 羽 on 2015/12/17.
 */
@Service
public class DigroadInfoServiceImpl implements DigroadInfoService {

    @Autowired
    private DigroadInfoMapper digroadInfoMapper;

    @Override
    public PageData<DigroadInfo> listByPage(Map<String, String> param) {
        PageData<DigroadInfo> pageData = new PageData<DigroadInfo>();
        CommPageBean pageBean = CommPageBean.getPageBeanByParam(param);
        List<DigroadInfo> list = digroadInfoMapper.listByPage(param, pageBean);
        pageData.setPageBean(pageBean);
        pageData.setListData(list);

        return pageData;

    }

    @Override
    public DigroadInfo selectByPrimaryKey(String id) {
        return digroadInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByRecord(DigroadInfo digroadInfo) {
        return digroadInfoMapper.updateByRecord(digroadInfo);
    }

    @Override
    public int insertSelective(DigroadInfo digroadInfo) {
        return digroadInfoMapper.insertDigroad(digroadInfo);
    }

    @Override
    public List<DigroadInfo> listAll(Map<String, String> param) {
        return digroadInfoMapper.listAll(param);
    }

    @Override
    public void updateStatus(String curtime) {
        digroadInfoMapper.updateStatus(curtime);
    }

    @Override
    public List<DigroadInfo> listNoEnd() {
        return digroadInfoMapper.listNoEnd();
    }

    @Override
    public int deleteByIds(String[] ids) {
        return digroadInfoMapper.deleteByIds(ids);
    }
}
